package com.hnust.fiveonesix.MyConfig;

import com.hnust.fiveonesix.Component.MyLocaleResolver;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/index").setViewName("商城模板部分/商城首页");
        registry.addViewController("/resign").setViewName("index");
        registry.addViewController("/Register").setViewName("Register");
        registry.addViewController("/checkout").setViewName("商城模板部分/checkout");
        registry.addViewController("/categorie").setViewName("商城模板部分/shopthings/food");
        registry.addViewController("/shoe").setViewName("商城模板部分/shopthings/shoes");
        registry.addViewController("/other").setViewName("商城模板部分/shopthings/other");
        registry.addViewController("/contact").setViewName("商城模板部分/contact");
        registry.addViewController("/car").setViewName("cart");
        registry.addViewController("/log").setViewName("index");
        registry.addViewController("/chanpwd").setViewName("ChanPwd");

    }
    @Bean
    public LocaleResolver localeResolver(){
        return new MyLocaleResolver();
    }
}
